﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <!--<xsl:output method="xml" indent="yes"/>-->

  <xsl:template match="question[type='text']">
    <div class="text-question">
      <H1 class="q-category">
        <xsl:value-of select="../@name"/> - <xsl:value-of select="cost"/>
      </H1>
      <p class="q-text">
        <xsl:value-of select="text"/>
      </p>
      <table id="playersButtons">
        <tr>
          <td>Player 1
            <div class="plusminusContainer">
              <div class="plus" />
              <div class="minus" />
            </div>
          </td>
          <td>Player 2 
          	<div class="plusminusContainer">
              <div class="plus" />
              <div class="minus" />
            </div>
          </td>
          <td>Player 3 
          	<div class="plusminusContainer">
              <div class="plus" />
              <div class="minus" />
            </div>
          </td>
        </tr>
      </table>
	</div>
  </xsl:template>  
  <xsl:template match="question[type='image']">
    <div class="text-question">
      <H1 class="q-category">
        <xsl:value-of select="../@name"/> - <xsl:value-of select="cost"/>
      </H1>
      <img class="q-image" align="middle">
      	<xsl:attribute name="src">
        	q-img/<xsl:value-of select="image"/>
        </xsl:attribute>
      </img>
      <p class="q-text">
        <xsl:value-of select="text"/>
      </p>
      <table id="playersButtons">
        <tr>
          <xsl:call-template name="gen_btns">
            <xsl:with-param name="player">Player 1</xsl:with-param>
          </xsl:call-template>
          <xsl:call-template name="gen_btns">
            <xsl:with-param name="player">Player 2</xsl:with-param>
          </xsl:call-template>
          <xsl:call-template name="gen_btns">
            <xsl:with-param name="player">Player 3</xsl:with-param>
          </xsl:call-template>
        </tr>
      </table>
    </div>
  </xsl:template>
  <xsl:template name="gen_btns">
    <xsl:param name="player"/>
    <td><xsl:value-of select="$player"/>
      <div class="plusminusContainer">
        <div class="plus" />
        <div class="minus" />
      </div>
    </td>
  </xsl:template>
</xsl:stylesheet>